/*
会飘的手
*/

var { Plot } = require("../Plot.js");
var { Point } = require("../Point")
/**
 * @type {HTMLCanvasElement}
 */
var canvasDom = document.querySelector("#myCanvas");
var plot = new Plot(canvasDom)
var context = canvasDom.getContext("2d");
canvasDom.width = document.body.clientWidth;;
canvasDom.height = document.body.clientHeight;

var list = [];
var i00 = 0;

plot.fillColor([0,0,0,255])
var Pressure = require('pressure');

Pressure.config({
  polyfill: false,
  polyfillSpeedDown: 0,
  preventDefault: true,
  only: null
});
var time00 = 0;

Pressure.set('#myCanvas', {
  change: function(force){

		list.push({ y: force * canvasDom.height, x: i00++ })

		if(time00%100==0){
			plot.drawList(list);
		}
  }
});

// 测试  browserify -o pack.js ./pointEvent.jsbrowserify -o